home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 644 b | 37 lines | [TEXT/CWIE] |
- // SpecialKeyMessage.h
-
- #ifndef SpecialKeyMessage_h
- #define SpecialKeyMessage_h
-
- #ifndef KeyMessage_h
- #include "KeyMessage.h"
- #endif
- #ifndef Commander_h
- #include "Commander.h"
- #endif
-
- template < class TheProtocol >
- class SpecialKeyMessage: public KeyMessage
- {
- typedef TheProtocol Protocol;
- typedef void (Protocol::*MethodType)();
-
- private:
- MethodType method;
-
- public:
- SpecialKeyMessage( MethodType theMethod )
- : method( theMethod )
- {}
-
- MethodType Method() const { return method; }
-
- virtual void Send() const
- {
- if ( !Commander<Protocol>::Null() )
- ((*Commander<Protocol>()).*method)();
- }
- };
-
- #endif
-